{include file="public/header" /}

<body>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <fieldset id="searchFieldset_currentTableRenderId" class="table-search-fieldset">
                            <legend>条件搜索</legend>
                            <form class="layui-form layui-form-pane form-search">
                                <div class="layui-form-item layui-inline">
                                    <label class="layui-form-label">类型</label>
                                    <div class="layui-input-inline">
                                        <select name="type">
                                            <option value="">请选择务类型</option>
                                            <option value="1" {if !empty(input('get.type')) &&
                                                input('get.type')==1}selected{/if}>上门服务</option>
                                            <option value="2" {if !empty(input('get.type')) &&
                                                input('get.type')==2}selected{/if}>本地商家</option>
                                            <option value="3" {if !empty(input('get.type')) &&
                                                input('get.type')==3}selected{/if}>社区邻工</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-form-item layui-inline">
                                    <label class="layui-form-label">商家</label>
                                    <div class="layui-input-inline">
                                        <select name="businessid">
                                            <option value="">请选择务商家(仅本地商家栏目可用)</option>
                                            {foreach $business as $v}
                                            <option value="{$v.id}" {if !empty(input('get.businessid')) &&
                                                input('get.businessid')==$v.id}selected{/if}>
                                                {$v.title|default=''}(账号:{$v.account|default=''})</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-form-item layui-inline">
                                    <label class="layui-form-label">分类名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="name" placeholder="请输入分类名称"
                                            value="{:input('get.name')}" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item layui-inline">
                                    <button class="layui-btn layui-btn-normal" lay-submit=""
                                        lay-filter="sreach">搜索</button>
                                </div>
                            </form>
                        </fieldset>
                    </div>
                    <div class="layui-card-body layui-row layui-col-space10">
                        <button class="layui-btn layui-bg-cyan layui-btn-sm"
                            onclick="open_add('添加轮播图','platclass_edit')">添加分类名称</button>
                        共有数据：<strong id="count">{$list->total()}</strong> 条
                    </div>
                    <div class="layui-table-body layui-table-main">
                        <table class="layui-table">
                            <thead>
                                <tr>
                                    <th>
                                        <div class="layui-table-cell">ID</div>
                                    </th>
                                    <th>
                                        <div class="layui-table-cell">类型</div>
                                    </th>
                                    <th>
                                        <div class="layui-table-cell">商家</div>
                                    </th>
                                    <th>
                                        <div class="layui-table-cell">名称</div>
                                    </th>
                                    <th>
                                        <div class="layui-table-cell">排序[越大越靠前]</div>
                                    </th>
                                    <th>
                                        <div class="layui-table-cell">图标</div>
                                    </th>

                                    <th>
                                        <div class="layui-table-cell">操作</div>
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                {foreach $list as $v}
                                <tr>
                                    <td>
                                        <div class="layui-table-cell">{$v.id}</div>
                                    </td>
                                    <td>
                                        {switch name="v.type"}
                                        {case value="1"}<button type="button"
                                            class="layui-btn layui-bg layui-btn-sm">上门服务</button>{/case}
                                        {case value="2"}<button type="button"
                                            class="layui-btn layui-bg-black layui-btn-sm">本地商家</button>{/case}
                                        {case value="3"}<button type="button"
                                            class="layui-btn layui-bg-black layui-btn-sm">社区邻工</button>{/case}
                                        {default /}default
                                        {/switch}
                                    </td>
                                    <td>
                                        <div class="layui-table-cell">{$v.business_name}</div>
                                    </td>
                                    <td>
                                        <div class="layui-table-cell">{$v.name}</div>
                                    </td>
                                    <td>
                                        <div class="layui-table-cell">{$v.sort}</div>
                                    </td>
                                    <td>
                                        <div id="layer-photos-demo" class="layer-photos-demo">
                                            {if empty($v.images)}

                                            {else}
                                            <img layer-pid="" style="height: 40px;" layer-src="{$v.images}"
                                                src="{$v.images}" alt="">
                                            {/if}
                                        </div>
                                    </td>
                                    <td class="layui-table-col-special">
                                        <div class="layui-table-cell">
                                            <a title="子类管理"
                                                onclick="open_add('子类管理','/system/platsons?platclassid={$v.id}')"
                                                href="javascript:;" class="layui-btn layui-btn-normal layui-btn-sm">
                                                子类管理
                                            </a>
                                            <a title="编辑" onclick="open_add('编辑','/system/platclass_edit?id={$v.id}')"
                                                href="javascript:;" class="layui-btn layui-btn-sm">
                                                编辑
                                            </a>
                                            <a title="删除" onclick="open_dels(this,'/system/platclass_del','{$v.id}')"
                                                href="javascript:;" class="layui-btn-danger layui-btn layui-btn-sm">
                                                删除
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}

                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body ">
                        <div class="page">
                            {$list->render()|raw}
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    {include file="public/footer"}
    <script>
        layui.use(['form', 'layer'], function () {
            $ = layui.jquery;
            var form = layui.form
                , layer = layui.layer;
        });
    </script>
</body>